package cn.sytton.taffecloud.service.job.controller;

import cn.sytton.taffecloud.common.base.doc.Api;
import cn.sytton.taffecloud.common.base.doc.ApiImplicitParam;
import cn.sytton.taffecloud.common.base.doc.ApiOperation;
import cn.sytton.taffecloud.common.base.doc.ParamType;
import cn.sytton.taffecloud.common.db.model.PageParam;
import cn.sytton.taffecloud.service.job.entity.JobLogEntity;
import cn.sytton.taffecloud.service.job.service.IJobLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 定时任务控制层
 *
 * @author skyrock
 */
@Api(tags = "定时任务日志")
@RestController
@RequestMapping("/log")
public class JobLogController {

    @Resource
    private IJobLogService jobLogService;

    @ApiOperation("查询分页定时任务列表")
    @ApiImplicitParam(name = "pp", value = "分页参数对象", paramType = ParamType.query, dataTypeClass = PageParam.class)
    @GetMapping
    public PageInfo<JobLogEntity> findListPage(PageParam pp) {
        return jobLogService.findListPage(pp);
    }

}
